package com.yisu.auction.api.core.mapper;

import com.yisu.auction.api.domain.request.ArchiveFileRequest;
import com.yisu.auction.api.domain.request.prizePackage.*;
import com.yisu.auction.api.domain.vo.PrizePackageVos.HistoricalTendencyVo;
import com.yisu.auction.api.domain.vo.goodsInfoPackageVos.AuctionResultVo;
import com.yisu.auction.api.domain.vo.goodsInfoPackageVos.LatestAnnouncedVo;
import com.yisu.auction.api.domain.vo.goodsInfoPackageVos.PreviousRecordVo;
import com.yisu.auction.api.domain.vo.goodsInfoPackageVos.PrizeVo;
import com.yisu.auction.api.domain.vo.indexPackageVos.PrizeListVo;
import com.yisu.auction.ewf.entity.Prize;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PrizeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Prize record);

    int insertSelective(Prize record);

    Prize selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Prize record);

    int updateByPrimaryKeyWithBLOBs(Prize record);

    int updateByPrimaryKey(Prize record);


    /**
     * author: 赵杰
     * Business Description：开奖状态更新
     * @return
     */
    int updateOpenPrizeStatus(Prize record);


    /**
     * author: 赵杰
     * Business Description：开奖
     * @return
     */
    int actionOpenPrize(Prize record);


    /**
     * author: 赵杰
     * Business Description：获取新手活动竞品详情
     * @return
     */
    Prize getNewActivitiesPrize();

    /**
     * author: 赵杰
     * Business Description：通过列表类型，获取正在进行中的奖品列表
     * @param prizeListRequest
     * @return
     */
    List<PrizeListVo> getPrizeListForUnderway(PrizeListRequest prizeListRequest);

    /**
     * author: 赵杰
     * Business Description：通过列表类型，获取新手专区奖品列表
     * @param prizeListRequest
     * @return
     */
    List<PrizeListVo> getPrizeListForNoviceArea(PrizeListRequest prizeListRequest);

    /**
     * author: 赵杰
     * Business Description：通过列表类型，获取个人在拍的奖品列表
     * @param prizeListRequest
     * @return
     */
    List<PrizeListVo> getPrizeListForMySelf(PrizeListRequest prizeListRequest);

    /**
     * author: 赵杰
     * Business Description：通过竞品ID获取竞品详情
     * @param prizeDetailRequest 含竞品ID
     * @return
     */
    PrizeVo getPrizeDetailByPrizeId(PrizeDetailRequest prizeDetailRequest);

    /**
     * author: 赵杰
     * Business Description：通过商品ID获取下期prizeId
     * @param goodsId
     * @return
     */
    long getNextPeriodPrizeIdByGoodsId(@Param("goodsId") long goodsId);

    /**
     * author: 赵杰
     * Business Description：通过竞品ID往期记录
     * @param previousRecordRequest 含prizeId
     * @return
     */
    List<PreviousRecordVo> getPreviousRecordListByPrizeId(PreviousRecordRequest previousRecordRequest);


    /**
     * author: 赵杰
     * Business Description：通过类型ID获取竞品ID
     * @param prizeListRequest 类型ID
     * @return
     */
    List<PrizeListVo> getPrizeListByGoodsTypeId(PrizeListRequest prizeListRequest);

    /**
     * author: 赵杰
     * Business Description：通过prizeId更新最终成交价
     * @param prizeId prizeId
     * @return
     */
    int updateTransactionPrice(@Param("prizeId") long prizeId);


    /**
     * author: 赵杰
     * Business Description：获取最新揭晓列表
     * @param latestAnnouncedRequest
     * @return
     */
    List<LatestAnnouncedVo> getLatestAnnouncedList(LatestAnnouncedRequest latestAnnouncedRequest);

    /**
     * author: 黄萧林
     * Business Description：获取全部参与竞拍数据
     * @param mineAuctionListRequest
     * @return
     */
    List<PrizeVo> getAllMineAuctionList(MineAuctionListRequest mineAuctionListRequest);
    /**
     * author: 黄萧林
     * Business Description：获取正在参与的竞拍数据
     * @param mineAuctionListRequest
     * @return
     */
    List<PrizeVo> getProcessMineAuctionList(MineAuctionListRequest mineAuctionListRequest);
    /**
     * author: 黄萧林
     * Business Description：获取拍中的竞拍数据
     * @param mineAuctionListRequest
     * @return
     */
    List<PrizeVo> getWinningMineAuctionList(MineAuctionListRequest mineAuctionListRequest);
    /**
     * author: 黄萧林
     * Business Description：获取未拍中的竞拍数据
     * @param mineAuctionListRequest
     * @return
     */
    List<PrizeVo> getLosingMineAuctionList(MineAuctionListRequest mineAuctionListRequest);

    /**
     * author:黄萧林
     * Business Description:获取待签收的竞拍数据
     * @param mineAuctionListRequest
     * @return
     */
    List<PrizeVo> getWaitSignForMineAuctionList(MineAuctionListRequest mineAuctionListRequest);


    /**
     * author:黄萧林
     * Business Description:获取待晒单的竞拍数据
     * @param mineAuctionListRequest
     * @return
     */
    List<PrizeVo> getWaitShowOrderListMineAuctionList(MineAuctionListRequest mineAuctionListRequest);

    /**
     * author:黄萧林
     * Business Description:获取历史走势数据列表
     * @param goodsId
     * @return
     */
    List<HistoricalTendencyVo> getHistoricalTendencyListByPrizeId(Long goodsId);


    /**
     * author:赵杰
     * Business Description:通过prizeId获取竞拍结果
     * @param prizeId
     * @return
     */
    AuctionResultVo getAuctionResultByPrizeId(@Param("prizeId") long prizeId);

    /**
     * author: 赵杰
     * Business Description：通过商品ID和期号获取当前的prizeId
     * @param prizeDetailRequest
     * @return
     */
    long getPrizeIdByGoodsIdAndTerm(PrizeDetailRequest prizeDetailRequest);

    /**
     * author: 赵杰
     * Business Description：通过时间获取归档竞品列表
     * @param archiveFileRequest
     * @return
     */
    List<Prize> getArchivePrizeList(ArchiveFileRequest archiveFileRequest);

    /**
     * author: 赵杰
     * Business Description：通过时间获取
     * @param archiveTime
     * @return
     */
    Integer getArchivePrizeCountByArchiveTime(@Param("archiveTime") String archiveTime);

}